package vip.xiaonuo.modular.business.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.param.BiIndexData.QueryParam;
import vip.xiaonuo.modular.business.param.StoreQueryParam;
import vip.xiaonuo.modular.business.service.PortraitService;

import javax.annotation.Resource;

/**
 * 区域及门店消费者画像统计展示
 * @Author: liu
 * @Date:2022/11/15
 */
@RestController
public class PortraitController {
    @Resource
    private PortraitService portraitService;
    /**
     * 查询单个点位的网格画像
     * @param param
     * @return
     */
    @PostMapping("/business/portrait/queryGridPortrait")
    public ResponseData queryGridPortrait(@RequestBody QueryParam param){
        return new SuccessResponseData(portraitService.queryGridPortrait(param));
    }

    /**
     * 统计区域内的网格画像
     * 统计：文化程度、地域、消费偏好
     * @param param
     * @return
     */
    @PostMapping("/business/portrait/statisticsGridPortrait")
    public ResponseData statisticsGridPortrait(@RequestBody QueryParam param){
        return new SuccessResponseData(portraitService.statisticsGridPortrait(param));
    }

    @PostMapping("/business/portrait/queryStorePortrait")
    public ResponseData queryStorePortrait(@RequestBody StoreQueryParam param){
        return new SuccessResponseData(portraitService.queryStorePortrait(param));
    }
}
